package com.example.test.entity;

import org.omg.CORBA.Object;

import java.lang.reflect.Array;
import java.util.function.IntFunction;
@SuppressWarnings("unchecked")
public class MyList<T> {

    public T[] list;


    public static <T extends Comparable>T[] minmax(T...a){
        Comparable[] c = new Comparable[2];
        return (T[]) c;
    }



    public static <T extends Comparable>T[] minmax2(T...a){
        T[] ts = (T[]) Array.newInstance(a.getClass().getComponentType(), 2);
        return ts;
    }



    public static <T extends Comparable>T[] minmax3(IntFunction<T[]> c, T...a){
        T[] apply = c.apply(2);
        return apply;
    }


}
